package Day1;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改
/**
 * 2020JavaB真题: 门牌制作
 * https://www.lanqiao.cn/problems/592/learning/?problem_list_id=2&page=1&tags=2020&tag_relation=union
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int count = 0;
        for(int i = 1; i <= 2020; i++){
          int num = i;
          while(num != 0){
            if(num % 10 == 2){
              count++;
            }
            num/=10;
          }
        }
        System.out.println(count);
        scan.close();
    }
}